<template>
      <table class="table table-bordered table-hover table-striped" border="1">
          <tr>
              <td>用户名</td>
              <td>{{info.UL_Name}}</td>
          </tr>
          <tr>
              <td>密码</td>
              <td>{{info.UL_PassWord}}</td>
          </tr>
          <tr>
              <td>真实姓名</td>
              <td>{{info.U_Name}}</td>
          </tr>
          <tr>
              <td>手机号</td>
              <td>{{info.U_Phone}}</td>
          </tr>
          <tr>
              <td>身份证号</td>
              <td>{{info.U_IdCard}}</td>
          </tr>
          <tr>
              <td>出生日期</td>
              <td>{{info.U_Date.substring(0,10)}}</td>
          </tr>
          <tr>
              <td>性别</td>
              <td>{{info.U_Sex==true?"男":"女"}}</td>
          </tr>
          <tr>
              <td>年收入</td>
              <td>{{info.U_Income}}</td>
          </tr>
          <tr>
              <td>用户类型</td>
              <td>{{info.UT_Name}}</td>
          </tr>
      </table>
</template>

<script setup lang="ts">
import { ref,onMounted} from 'vue';
import axios from 'axios';

import {useUserStore} from '../../Store/Index.ts';

const Store = useUserStore();

const info =ref({
    UL_Name:"",
    UL_PassWord:"",
    U_Name:"",
    U_Phone:"",
    U_IdCard:"",
    U_Date:"",
    U_Sex:false,
    U_Income:"",
    UT_Name:""
});

onMounted(()=>{
    LoadData();
})

const LoadData = ()=>{
     axios({
        url:"https://localhost:44337/api/Users/ShowUserInfo",
        method:"get",
        params:{
            Uid:Store.Uid
        }
     }).then(res=>{
         console.log(res.data);
         info.value = res.data[0]
     }).catch(err=>{
        console.log(err);
     })
}
</script>